﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Uco.Models;
using System.Net.Mail;
using System.Text;
using System.Configuration;
using System.Text.RegularExpressions;

namespace Uco.Infrastructure
{
    public static class SendMail
    {

        public static void Send(string MailTo, string Subject, string Body)
        {
            SmtpClient client = new SmtpClient();
            string MailFrom = ConfigurationManager.AppSettings["MailFrom"];
            MailMessage mm = new MailMessage(MailFrom, MailTo);
            mm.IsBodyHtml = true;
            mm.SubjectEncoding = Encoding.GetEncoding(1255);
            mm.BodyEncoding = Encoding.UTF8;
            if (Subject != null) Subject = Subject.Replace("\r\n", "");
            mm.Body = Body;
            client.Send(mm);
        }
    }
}